/*
 * @Date: 2022-08-28 17:34:03
 * @LastEditors: czp
 * @LastEditTime: 2023-04-11 09:45:36
 */

import { defineStore } from "pinia";
import { userGetUserInfo } from "@/service/modules/user";
import { IUserState } from "./interface/user";
export const useUserStore = defineStore("user", {
	state: (): IUserState => ({
		// 用户信息
		userInfo: null
	}),
	getters: {},
	actions: {
		/**
		 * 获取用户信息
		 */
		async actionGetUserInfo() {
			const { data } = await userGetUserInfo();
			this.userInfo = data;
		}
	}
});
